﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using QuanLyDuocPham.Controllers.QuanLyHeThong.DanhMuc;
using QuanLyDuocPham.Controllers.QuanLyHeThong.NhapXuat;

namespace QuanLyDuocPham
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class BanLe_View : Window
    {
        KHO_Control khoctrl = new KHO_Control();
        DUOCPHAM_Control dpctrl = new DUOCPHAM_Control();
        KHACHHANG_Control khctrl = new KHACHHANG_Control();
        private void BanLe_View_Loaded(object sender, RoutedEventArgs e)
        {
            
        }
        
        private void loadHoaDon()
        {
            //hd.load_HoaDon(lvHoaDon_List);
        }
        public BanLe_View()
        {
            InitializeComponent();
            LoadButtonAndText("BanLeKhongTheoDon");

        } 
        UIElement ui;
        //Controllers.PhanMemBanLe.HoaDon_Control hd = new Controllers.PhanMemBanLe.HoaDon_Control();
        public void LoadButtonAndText(string h)
        {
            switch (h)
            {
                case "BanLeKhongTheoDon":
                    btnKhongTheoDon.Visibility = Visibility.Hidden;
                    lblChuanDoan.Visibility = Visibility.Hidden;
                    txtChuanDoan.Visibility = Visibility.Hidden;
                    lblBacSi.Visibility = Visibility.Hidden;
                    txtBacSi.Visibility = Visibility.Hidden;
                    lblBSTV.Visibility = Visibility.Visible;
                    txtBacsiTV.Visibility = Visibility.Visible;
                    break;
                case "BanLeTheoDon":
                    btnKhongTheoDon.Visibility = Visibility.Visible;
                    lblChuanDoan.Visibility = Visibility.Visible;
                    txtChuanDoan.Visibility = Visibility.Visible;
                    lblBacSi.Visibility = Visibility.Visible;
                    txtBacSi.Visibility = Visibility.Visible;
                    lblBSTV.Visibility = Visibility.Hidden;
                    txtBacsiTV.Visibility = Visibility.Hidden;
                    break;
            }


        }

        private void btnTheoDon_Click(object sender, RoutedEventArgs e)
        {
            LoadButtonAndText("BanLeTheoDon");

        }

        private void btnKhongTheoDon_Click(object sender, RoutedEventArgs e)
        {
            LoadButtonAndText("BanLeKhongTheoDon");
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {

        }

        private void txtMaVach_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Return)
            {
                
            }
        }

        private void cbTenDP_KeyDown(object sender, KeyEventArgs e)
        {
            cbTenDP.IsDropDownOpen = true;
        }
        
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            dpctrl.loadComboBoxBanLe(cbTenDP, txtMa_Kho);
            khctrl.loadComboBox(cmbKhachHang);
        }

        private void cmbKhachHang_KeyDown(object sender, KeyEventArgs e)
        {
            cmbKhachHang.IsDropDownOpen = true;
        }


    }
}
